<html>
<head><meta charset="utf-8"><title>bikeshed: `ExpnId` vs `InvocId` · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/bikeshed.3A.20.60ExpnId.60.20vs.20.60InvocId.60.html">bikeshed: `ExpnId` vs `InvocId`</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="169472185"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/bikeshed%3A%20%60ExpnId%60%20vs%20%60InvocId%60/near/169472185" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/bikeshed.3A.20.60ExpnId.60.20vs.20.60InvocId.60.html#169472185">(Jul 02 2019 at 11:24)</a>:</h4>
<p>Should I rename <code>Mark</code> into <code>ExpnId</code> or <code>InvocId</code>? <span aria-label="slight smile" class="emoji emoji-1f642" role="img" title="slight smile">:slight_smile:</span></p>
<p>"<code>Mark</code>" identifies both a macro invocation (<code>foo!()</code>), and expansion process and expansion result of that macro invocation.</p>



<a name="169472209"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/bikeshed%3A%20%60ExpnId%60%20vs%20%60InvocId%60/near/169472209" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/bikeshed.3A.20.60ExpnId.60.20vs.20.60InvocId.60.html#169472209">(Jul 02 2019 at 11:25)</a>:</h4>
<p>(Depending on the context.)</p>



<a name="169472253"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/bikeshed%3A%20%60ExpnId%60%20vs%20%60InvocId%60/near/169472253" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/bikeshed.3A.20.60ExpnId.60.20vs.20.60InvocId.60.html#169472253">(Jul 02 2019 at 11:26)</a>:</h4>
<p><code>Mark</code> itself is obviously bad because nobody knows what it is.</p>



<a name="169472396"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/bikeshed%3A%20%60ExpnId%60%20vs%20%60InvocId%60/near/169472396" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/bikeshed.3A.20.60ExpnId.60.20vs.20.60InvocId.60.html#169472396">(Jul 02 2019 at 11:28)</a>:</h4>
<p>On one hand, the invocation is primary and its expansion is secondary, but on another hand "invocation" may mean a <code>for</code> loop (with "expansion" == "desugaring"), or be entirely invisible in case of e.g. test harness generation.</p>



<a name="169472682"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/bikeshed%3A%20%60ExpnId%60%20vs%20%60InvocId%60/near/169472682" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/bikeshed.3A.20.60ExpnId.60.20vs.20.60InvocId.60.html#169472682">(Jul 02 2019 at 11:34)</a>:</h4>
<p>One naming example: <code>ExpnInfo</code> is some data attached to the ID in question, it is actively used by various lints, for example.<br>
Would it look better as <code>InvocInfo</code>? Probably not, since it's usually obtained from a span and span is more associated with an expansion of a macro than with its call.</p>



<a name="169473363"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/bikeshed%3A%20%60ExpnId%60%20vs%20%60InvocId%60/near/169473363" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/bikeshed.3A.20.60ExpnId.60.20vs.20.60InvocId.60.html#169473363">(Jul 02 2019 at 11:47)</a>:</h4>
<p><span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span> to <code>ExpnId</code>.</p>



<a name="169480953"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/bikeshed%3A%20%60ExpnId%60%20vs%20%60InvocId%60/near/169480953" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/bikeshed.3A.20.60ExpnId.60.20vs.20.60InvocId.60.html#169480953">(Jul 02 2019 at 13:37)</a>:</h4>
<p>I think we can afford <code>ExpanId</code>; <code>Expn</code> looks too similar to <code>Expr</code></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>